<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
    <div class="container-div">
    <div class="row">
    	<div class="col-sm-12 search-collapse">
				<form id="incomeInfo-form">
					<div class="select-list">
						<ul>
							<li>
								考核年月：<input type="text" name="incMonth" th:value="*{incomeInfo.incMonth}" readonly="readonly"/>
							</li>
							<li>
								项目名称：<input type="text" name="proName" th:value="*{incomeInfo.proName}" readonly="readonly"/>
							</li>
							<li>
								<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
							    <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
							</li>
						</ul>
					</div>
				</form>
			</div>
		<div class="btn-group-sm hidden-xs" id="toolbar" role="group">
			<a class="btn btn-primary btn-edit disabled" onclick="$.operate.edit()" shiro:hasPermission="pm:incomeDetail:edit">
	            <i class="fa fa-edit"></i> 修改
	        </a>
			<a class="btn btn-danger btn-del btn-del disabled" onclick="$.operate.removeAll()" shiro:hasPermission="pm:incomeDetail:remove">
				<i class="fa fa-remove"></i> 删除
			</a>
		</div>
			
		<div class="col-sm-12 select-table table-striped">
			<table id="bootstrap-table" data-mobile-responsive="true"></table>
		</div>
    </div>
    <div th:include="include :: footer"></div>
    <script th:inline="javascript">
        var detailFlag = [[${@permission.hasPermi('pm:incomeDetail:detail')}]];
        var wlDatas = [[${@dict.getType('pm_emp_level')}]];
        var prefix = ctx + "pm/incomeDetail";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                detailUrl: prefix + "/detail/{id}",
                modalName: "确认单明细",
                queryParams: queryParams,
                uniqueId:"incdId",
                search:false,
                showSearch:false,
                showColumns:false,
                showToggle:false,
                showExport:false,
                showRefresh:false,
                columns: [{
		            checkbox: true
		        },
				{
					field : 'incdId', 
					title : '主键',
					visible: false 
				},
				{
					field : 'proSelfSn', 
					title : '公司项目编号' 
				},
				{
					field : 'proName', 
					title : '项目名称' 
				},
				{
					field : 'empId', 
					title : '证件号码' 
				},
				{
					field : 'empNm', 
					title : '姓名' 
				},
				{
					field : 'wlLevel', 
					title : '人员级别',
		            formatter: function(value, row, index) {
		            	return $.table.selectDictLabel(wlDatas, value);
		            }
				},
				{
					field : 'wlUnp', 
					title : '人员单价' 
				},
				{
					field : 'signDays', 
					title : '考勤天数' 
				},
				{
					field : 'wlTotal', 
					title : '合计金额' 
				},
				{
					field : 'incId', 
					title : '收入主键',
					visible: false 
				},
				{
					field : 'compNm', 
					title : '公司名称'
				},
		        {
		            title: '操作',
		            align: 'center',
		            formatter: function(value, row, index) {
		            	var actions = [];
		            	actions.push('<a class="btn btn-info btn-xs ' + detailFlag + '" href="#" onclick="$.operate.detail(\'' + row.incdId + '\')"><i class="fa fa-search"></i>详细</a> ');
		            	return actions.join('');
		            }
		        }]
            };
            $.table.init(options);
        });
        
        function queryParams(params) {
			return {
				incId:          $("input[name='incId']").val(),
				pageSize:       params.limit,
    			pageNum:        params.offset/params.limit + 1,
    			searchValue:    params.search,
    			orderByColumn:  params.sort,
    			isAsc:          params.order
			};
		}
    </script>
</body>
</html>